<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="author" content="Jiří Němec" />
  <title>BLP pic-a(lbum)</title>

  <link rel="stylesheet" type="text/css" href="resources/css.php?style&amp;slimbox" />
  <script type="text/javascript" src="resources/js.php?mootools&amp;slimbox" ></script>
 </head>
 <body>
  <div id="page-wrap" >
   
   <?php

   $image_dir = 'images/';
   $read = false; // zapnete pokud nefunguje rewrite


   $per_column = 6;
   $thumbnailSize = 100;

   if ($handle = opendir($image_dir)) {
    while (false !== ($file = readdir($handle))) {
     if ($file != '.' && $file != '..') {
      if(eregi('.(png|jpg|gif|tiff)$',$file) && !eregi('.(png|jpg|gif|tiff)-[0-9whqec]+.(png|jpg|gif|tiff)$',$file)) {
       $files[] = $file;
      }
     }
    }
    closedir($handle);
   }

   static $lightbox = 0;
   if(count($files)) {
    sort($files);
    foreach($files as $file) {
     $count++;
     $title = '';
     echo '<a class="photo-link" rel="lightbox['.$lightbox.']" title="'.((file_exists($image_dir.$file.'.txt'))?file_get_contents($image_dir.$file.'.txt'):'').'" href="',($read?'read.php/':$image_dir),$file,'"><img src="',($read?'read.php/':$image_dir),$file,'-w'.$thumbnailSize.'h'.$thumbnailSize.'e0c1.jpg" width="'.$thumbnailSize.'" height="'.$thumbnailSize.'" /></a>';
     if($count % $per_column == 0) { echo '<div class="clear"></div>'; }
    }
   }
   else {
    echo '<p>There are no images in this gallery.</p>';
   }

   ?>
  </div>
 </body>
</html>